#ifndef H_CORE_MAP_H
#define H_CORE_MAP_H

#include "rbtree.h"

namespace QinChat{
    namespace Core{
        template <typename K, typename D>
         class CMapNode{
            public:
                explicit CMapNode(void);
                explicit CMapNode(const K& strType, const D& data);
                explicit CMapNode(const CMapNode& other);
                bool operator< (const CMapNode& other);
                bool operator> (const CMapNode& other);
                bool operator== (const CMapNode& other);
                CMapNode& operator= (const CMapNode& other);
                K& GetKey() const { return  m_key;}
                D& GetData() { return  m_data;}
                const D& GetData() const { return  m_data;}
            private:
                K m_key;
                D m_data;
        };

        template <typename K, typename D>
        class CMap{
            public:
                bool IsContains(const K& key);
                bool Insert(const K& key, const D& data);
                bool Find(const K& key, D& data);
            private:
                RBTree<CMapNode<K, D> > m_rbtree;
               
        };
    }
}

#include "map.inl"

#endif //  H_CORE_MAP_H